home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 3.iso / dist / fw_qt3.idb / usr / freeware / Qt / examples / themes / metal.h.z / metal.h
C/C++ Source or Header  |  2002-04-08  |  2KB  |  71 lines

  1. /****************************************************************************
  2. ** $Id:  qt/metal.h   3.0.3   edited Dec 4 19:47 $
  3. **
  4. ** Definition of the Metal Style for the themes example
  5. **
  6. ** Created : 979899
  7. **
  8. ** Copyright (C) 1997 by Trolltech AS.  All rights reserved.
  9. **
  10. ** This file is part of an example program for Qt.  This example
  11. ** program may be used, distributed and modified without limitation.
  12. **
  13. *****************************************************************************/
  14.  
  15. #ifndef METAL_H
  16. #define METAL_H
  17.  
  18. #include <qwindowsstyle.h>
  19. #include <qpalette.h>
  20.  
  21. #ifndef QT_NO_STYLE_WINDOWS
  22.  
  23. class MetalStyle : public QWindowsStyle
  24. {
  25. public:
  26.     MetalStyle();
  27.     void polish( QApplication*);
  28.     void unPolish( QApplication*);
  29.     void polish( QWidget* );
  30.     void unPolish( QWidget* );
  31.  
  32.     void drawPrimitive( PrimitiveElement pe,
  33.             QPainter *p,
  34.             const QRect &r,
  35.             const QColorGroup &cg,
  36.             SFlags flags = Style_Default,
  37.             const QStyleOption& = QStyleOption::Default) const;
  38.  
  39.     void drawControl( ControlElement element,
  40.               QPainter *p,
  41.               const QWidget *widget,
  42.               const QRect &r,
  43.               const QColorGroup &cg,
  44.               SFlags how = Style_Default,
  45.               const QStyleOption& = QStyleOption::Default ) const;
  46.  
  47.     void drawComplexControl( ComplexControl cc,
  48.                  QPainter *p,
  49.                  const QWidget *widget,
  50.                  const QRect &r,
  51.                  const QColorGroup &cg,
  52.                  SFlags how = Style_Default,
  53.                  SCFlags sub = SC_All,
  54.                  SCFlags subActive = SC_None,
  55.                  const QStyleOption& = QStyleOption::Default ) const;
  56.     int pixelMetric( PixelMetric, const QWidget * ) const;
  57.  
  58.  
  59. private:
  60.     void drawMetalFrame(  QPainter *p, int x, int y, int w, int h ) const;
  61.     void drawMetalGradient( QPainter *p, int x, int y, int w, int h,
  62.               bool sunken, bool horz, bool flat=FALSE ) const;
  63.     void drawMetalButton( QPainter *p, int x, int y, int w, int h,
  64.               bool sunken, bool horz, bool flat=FALSE ) const;
  65.     QPalette oldPalette;
  66. };
  67.  
  68. #endif
  69.  
  70. #endif
  71.